//按钮点击事件
import { base, ajax, toast, print, output, printer, getBusinessInfo, cardCache } from 'nc-lightapp-front';
import api from '../../../common/api';
import config from '../config';
const { setDefData } = cardCache;

export default function (props, key, text, record, index) {
    switch (key) {
        case 'table_view':
            // this.searchModal.show();
            props.pushTo(`/card?id=${record.pk_costshare.value}`, {
                status: 'browse',
                id: record.pk_costshare.value
            });
            break;

        case 'table_edit':
            // this.searchModal.show();
            props.pushTo(`/card?id=${record.pk_costshare.value}`, {
                status: 'edit',
                id: record.pk_costshare.value
            });
            break;

        case 'table_delete':
            this.delete(record);
            break;

        case 'table_approve':
            this.approve(record);
            break;

        case 'table_unapprove':
            this.cancelApprove(record);
            break;
        default:
            break;
    }
}
